const app = getApp();
const Controller = require('../controllers/controllers.js').controller;
Page({
  data: {
    lists:[],
    isloading:true
  },
  onLoad: function (options) {
    this.myFamilyMemberList()
    if(options.parentid){
      app.globalData.parentid=options.parentid
    }
  },
  onShow: function () {
    
  },
  golink(e){
    if (!wx.getStorageSync('logintoken')) {
      app.ToLogin(true)
      return
    }
    var url=e.currentTarget.dataset.url;
    wx.navigateTo({
      url: url
    })
  },
  myFamilyMemberList(){
    Controller.myFamilyMemberList({source:5,parentId:0}).then(res=>{
      if(res.data.baseData.list.length>0){
        this.setData({
          lists:res.data.baseData.list,
        })
      }
      this.setData({
        isloading:false
      })
    })
  },
  onShareAppMessage: function (e) {
    let title = '';
    let imageUrl = '';
    let path=app.getCurrentPageUrlWithArgs()
    let obj = {
      title,
      imageUrl,
      path,
      success: function (res) {},
      fail(err) {}
    }
    return obj
  },
  onShareTimeline: function(res){
    let title = '';
    let imageUrl = '';
    let path=app.getCurrentPageUrlWithArgs()
    let obj = {
      title,
      imageUrl,
      path,
      success: function (res) {},
      fail(err) {}
    }
    return obj
  },
})